<?php 
include_once dirname(dirname(dirname(__FILE__))).'/include/user-verify.php';
include dirname(dirname(__FILE__)).'/user-manage/functions.php';
?>
<!DOCTYPE html>
<html>
<head>
		<?php include dirname(dirname(dirname(__FILE__))).'/include/common-header.php' ?>
		<link rel="stylesheet" type="text/css" href="../css/style.css">
		<title>通讯录查询</title>
</head>
	<body>
		<div class="col-md-12">
			<div>
				<h3>通讯录查询</h3>
			</div>
			<table class="table table-striped table-bordered table-hover table-condensed" id="default-table">
				<tr>
				  	<th>用户名</th>
				  	<th>学号</th>
				  	<th>姓名</th>
				  	<th>性别</th>
				  	<th>年级</th>
				  	<th>学院</th>
				  	<th>联系方式</th>
				  	<th>身份</th>
				  	<th>是否轮值</th>
				 </tr>
				<?php
				$items = getAllUser();
		  		foreach ($items as $item) {
		  			echo '
		  			<tr>
		  				<td>'.$item["username"].'</td>
		  				<td>'.$item["student_id"].'</td>
		  				<td>'.$item["user_real_name"].'</td>
		  				<td>'.$item["sex"].'</td>
		  				<td>'.$item["grade"].'</td>
		  				<td>'.$item["department"].'</td>
		  				<td>'.$item["phone"].'</td>
		  				<td>'.$item["user_role"].'</td>
		  				<td>';
		  				if($item["is_user_on_duty"]==1)echo "是";
				  		else echo "否";
				  		echo '</td>';
		  			echo '</tr>
		  			';
		  		}
				?>
			</table>
		</div>
	</body>
</html>